﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<select <%:ViewData["RoleID"] == null ? "" : (int)ViewData["RoleID"] ==1 ? "disabled" : ""%> name="CurrentRole">
	<%
		foreach (var x in z.Controllers.App.db.webpages_Roles) {
			Response.Write(
				string.Format("<option value=\"{0}\" {1}>{2}</option>", x.RoleId,
				ViewData["RoleID"] == null ? "" : (int)ViewData["RoleID"] == x.RoleId ? "selected" : "",
				x.RoleName));
		}
		Response.Write(
				string.Format("<option value=\"0\" {0}>User</option>",
				ViewData["RoleID"] == null ? "" : (int)ViewData["RoleID"] == 0 ? "selected" : ""));
	%>
</select>